package me.lc.hammerheads.sprite;

import me.lc.hammerheads.core.GameManager;
import me.lc.hammerheads.core.GameSystem;
import me.lc.hammerheads.core.StageManager;
import me.lc.hammerheads.entity.GameStageInfo;

import com.wiyun.engine.nodes.Node;
import com.wiyun.engine.nodes.Sprite;
import com.wiyun.engine.opengl.Texture2D;

/**
 * 地洞
 * 
 * @author Administrator
 * 
 */
public class Hole extends Node {
	Sprite holeSprite;

	private boolean isEmpty;

	public boolean isEmpty() {
		return isEmpty;
	}

	public void setEmpty(boolean isEmpty) {
		this.isEmpty = isEmpty;
	}

	public Hole() {
		Texture2D tex = GameSystem.tex_hole;

		// 获得当前的关卡
		GameStageInfo stage = StageManager.instance.getCurrentInfo();
		if (GameManager.instance.gameType == 1) {
			switch (stage.getBgType()) {
			case summer:
				tex = GameSystem.tex_hole_summer;
				break;
			case livingroom:
				tex = GameSystem.tex_hole_livingroom;
				break;
			case tarmac:
				tex = GameSystem.tex_hole_tarmac;
				break;
			case winter:
				tex = GameSystem.tex_hole_winter;
				break;
			}
		}

		holeSprite = Sprite.make(tex);
		this.addChild(holeSprite);
	}
}
